import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("homeStore")
class Shop extends BaseService {
	getParams({ dateArr, ...args }) {
		return { ...args, year: dateArr?.[0] || '', month: dateArr?.[1] || '' }
	}
	// 头部卡片
	topCards(query) {
		let params = this.getParams(query)
		return this.$get("/topCards", { params });
	}
	// 每月走势图
	monthTrend(query) {
		let params = this.getParams(query)
		return this.$get("/monthTrend", { params });
	}
	// 区域业绩
	regionRanking(query) {
		let params = this.getParams(query)
		return this.$get("/regionRanking", { params });
	}
	// 城市排行榜
	cityRanking(query) {
		let params = this.getParams(query)
		return this.$get("/cityRanking", { params });
	}
	// 门店业绩排行
	storeAchieveRanking(query) {
		let params = this.getParams(query)
		return this.$get("/storeAchieveRanking", { params });
	}
	// 单店业绩详情
	storeDetail(query) {
		let params = this.getParams(query)
		return this.$get("/storeDetail", { params });
	}
	// 技师业绩排行
	teacherRanking(query) {
		let params = this.getParams(query)
		return this.$get("/teacherRanking", { params });
	}
	// 技师业绩明细
	teacherDetail(query) {
		let params = this.getParams(query)
		return this.$get("/teacherDetail", { params });
	}
	// top10
	getTop10(query) {
		let params = this.getParams(query)
		return this.$get("/topTen", { params });
	}

	// 门店报表-分公司排行
	companyRanking(query) {
		let params = this.getParams(query)
		return this.$get("/companyRanking", { params });
	}
	// 门店报表-标签业绩
	tagAchieve(query) {
		let params = this.getParams(query)
		return this.$get("/tagAchieve", { params });
	}

	// 清除缓存
	clearCache(query) {
		let params = this.getParams(query)
		return this.$get('/clearCache', { params })
	}
}

export default Shop;
